﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Compilation;
using Eagle.Common;
using System.IO;
using System.Drawing.Imaging;
using Eagle.Module;
using System.Configuration;
using System.Collections.Specialized;
using System.Data.Common;
using System.Data;
using Eagle.Data;
using Eagle.Config;
using System.Globalization;
using System.Xml;

namespace Eagle.Web
{
    class A {
        static A() { 
            int z = 0; 
        }
        public A() {
            int z2 = 0; 
        }
    }

    class B
    {
        static B() { 
            int z = 0;
        }
        public B() {
            int z = 0; 
        }
    }

    public partial class Test : System.Web.UI.Page
    {
          private int _y;
          /// <summary>
          /// 
          /// </summary>
          public int y
          {
                get { return _y; }
                set { _y = value; }
          }

          #region  查找方法
          /// <summary>
          /// 查找方法
          /// </summary>
          /// <param name="id">商品编号</param>
          /// <returns>返回String</returns>
          //public String Select(Int32 id)
          //{
          //      //const string cmdText = "SELECT [Name] FROM [Goods] WHERE [ID]=@ID ";
          //      //List<DbParameter> parms = new List<DbParameter>(1);
          //      //parms.Add(DbUtils.CreateParameter("System.Data.SqlClient","@ID", id,ParameterDirection.Input));
          //      //return DbUtils.ExecuteScalar(cmdText, CommandType.Text, DataSettings.Eagle_ConnectionStrnig, parms.ToArray());
          //}
          #endregion

          #region  查找方法
          /// <summary>
          /// 查找方法
          /// </summary>
          /// <param name="name">商品名称</param>
          /// <returns>返回String</returns>
          //public String f(String name)
          //{
          //      const string cmdText = "SELECT [Name],[PageView] FROM [Goods] WHERE [Name]=@Name ";
          //      List<DbParameter> parms = new List<DbParameter>(1);
          //      parms.Add(DbUtils.CreateParameter("System.Data.SqlClient", "@Name", name, ParameterDirection.Input));
          //      return DbUtils.ExecuteScalar(cmdText, CommandType.Text, DataSettings.Eagle_ConnectionStrnig, parms.ToArray());
          //}
          #endregion





        protected void Page_Load(object sender, EventArgs e)
          {

              DbUtils.ExecuteNonQuery("select * from city", CommandType.Text, ConfigurationManager.ConnectionStrings["Eagle"].ConnectionString, null);
              string x = Isbn.ConvertISBN("L-ZXWX-0022");
              string y = string.Empty;
              //A a = new A();
              //XmlReader reader = new XmlTextReader(@"E:\ePub\金融海啸\OPS\toc.ncx");
            

              //string xxx = Request.Form["dd"];
              //string xxxx = Request.Form["ds"];
              //string xc = Request.Form["xxxx"];
              //string x = string.Empty;
                //Response.Write(DateTime.Now.ToString()+"<br>");

                //Response.Write(DateTime.Now.ToString("yyyy-MM-dd") + "<br>");
                //Response.Write(DateTime.Now.ToString("yyyy-MM-dd",CultureInfo.CurrentCulture) + "<br>");
                //Response.Write(DateTime.Now.ToString("yyyy-MM-dd", CultureInfo.InstalledUICulture) + "<br>");
                //Response.Write(DateTime.Now.ToString("yyyy-MM-dd", CultureInfo.GetCultureInfo("zh-TW")) + "<br>");


                //Response.Write(DateTime.Now.ToString(CultureInfo.CurrentCulture) + "<br>");
                //Response.Write(DateTime.Now.ToString(CultureInfo.InstalledUICulture) + "<br>");
                //Response.Write(DateTime.Now.ToString(CultureInfo.GetCultureInfo("zh-TW")) + "<br>");
                //Eagle.Data.Providers p = (Eagle.Data.Providers)ConfigurationManager.GetSection("ax/DataProvider");
                //NameValueCollection nvc = (NameValueCollection)ConfigurationManager.GetSection("ax/DataProvider");
                //Response.Write(nvc["dddd"]);
              ThumbnailImageSettings tis = new ThumbnailImageSettings("d:\\Collection.png", new int[] { 172 }, new int[] { 174 }, new string[] { "d:\\Collection2.png" });
              ThumbnailImage.Create(tis);
              //tis.OriginalXCollection = new int[] { 1000 };
              //tis.OriginalYCollection = new int[] { 500 };
              //tis.OriginalX2Collection = new int[] { 1800 };
              //tis.OriginalY2Collection = new int[] { 1100 };
              //tis.SaveThumbnailFileNames = new string[] { EagleUtils.ConvertToPhysicalPath("/k.jpg") };
              //ThumbnailImage.Create(tis);
            //IHttpHandler hander = BuildManager.CreateInstanceFromVirtualPath("~/default.aspx", typeof(Page)) as IHttpHandler;
            //hander.ProcessRequest(HttpContext.Current);
            //Stream s=HttpContext.Current.Response.Filter;
            //FileStream fs = new FileStream(Utils.ConvertToPhysicalPath("~/html.html"), FileMode.Create);
            //byte[] buffer=new byte[100000]; 
            //s.Read(buffer, 0, buffer.Length);
            //fs.Write(buffer, 0, buffer.Length);

            //string cbc = Security.Aes("薛", "you forget write", 1);
            //string CFB = Security.Aes("薛", "you forget write", 2);
            ////string CTS = Security.Aes("薛建川", "abc", 3);
            //string ECB = Security.Aes("薛", "you forget write", 4);
            ////string OFB = Security.Aes("薛建川", "abc", 5);


            //Response.Write("cbc:" + cbc + "<br>");
            //Response.Write("CFB:" + CFB + "<br>");
            ////Response.Write("CTS:" + CTS + "<br>");
            //Response.Write("ECB:" + ECB + "<br>");
            ////Response.Write("OFB:" + OFB + "<br>");
            //byte[] keyvector = { 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x2c, 0x49, 0x20, 0x61, 0x6d, 0x20, 0x4a, 0x61, 0x6e, 0x73, 0x2e };

            //foreach (byte b in keyvector)
            //{
            //    Response.Write((char)b);
            //}

            //Mirainsoft.ValidateCode.ValidateCodeFactory d = new Mirainsoft.ValidateCode.ValidateCodeFactory("3453", 150, 50);
            //System.IO.MemoryStream memorystream = new System.IO.MemoryStream(6);
            //d.Image.Save(memorystream, ImageFormat.Jpeg);
            //HttpContext.Current.Response.Clear();
            //HttpContext.Current.Response.ContentType = "image/jpeg";
            //HttpContext.Current.Response.BinaryWrite(memorystream.ToArray());
            //d.Dispose();

            //string a = Utils.ConvertToPhysicalPath(@"E:\番薯架构\番薯资源库\Fanshu.Resource\Fanshu.Resource.Web\BookContent\m.20100720-m084-w084-003\CEB\201007200840003.ceb");
            //Response.Write(a);
            //string b = Utils.ConvertToPhysicalPath("/201007200840003.ceb");
            //Response.Write("<br>"+b);
            //string c = AppDomain.CurrentDomain.BaseDirectory+"201007200840003.ceb";
            //Response.Write("<br>" + c);
            //string[] files = Directory.GetFiles(@"E:\书单\新建文件夹 (5000000)","*.jpg");
            //foreach (string file in files)
            //{
            //    ThumbnailImageSettings tis = new ThumbnailImageSettings(file, new int[] { 154 }, new int[] { 217 }, new string[] { @"E:\书单\新建文件夹 (5000000)\转化后\" + Path.GetFileNameWithoutExtension(file) + "fb.gif" });
            //    tis.GrayPicture = true;
            //    ThumbnailImage.Create(tis);

            //    ThumbnailImageSettings tis2 = new ThumbnailImageSettings(file, new int[] { 68 }, new int[] { 96 }, new string[] { @"E:\书单\新建文件夹 (5000000)\转化后\" + Path.GetFileNameWithoutExtension(file) + "fs.gif" });
            //    tis2.GrayPicture = true;
            //    ThumbnailImage.Create(tis2);
            //}
            //Utils.CreateDirectory("e:\\ff\\");
            //Utils.CreateDirectory("e:\\hh\\hhs");
            //Utils.CreateDirectory("e:\\gg\\hhs.txt");
        }
    }
}
